import {postForm,get,post} from "@/utils/request";
let getArtcateCates = ()=>{
    return get("/my/artcate/getcates")
}
let updatecate = (data)=>{
    return postForm("/my/artcate/updatecate",data)
}
/**
 * 新增文章分类
 */
let addCate = (data)=>{
    return postForm("/my/artcate/addcates",data)
} 
/**
 * 删除单个子节点
 * @returns 
 */
let delOneCate = (id)=>{
    return get(`/my/artcate/deletecate/${id}`)
}
/**
 * 批量删除子节点
 * @param {*} formData 
 * @returns 
 */
let delArrCate=(formData)=>{
    return postForm(`/my/artcate/deletecates`,formData)
}
/**
 * 获取用户文章列表预览
 * @param {*} formData 
 * @returns 
 */
let getMyArtclePre = (formData)=>{
    return postForm(`/my/artcate/search`,formData)
}
let getArtcateById = (id)=>{
    return get(`/my/artcate/cates/${id}`)
}
export {
    getArtcateCates,
    updatecate,
    addCate,
    delOneCate,
    delArrCate,
    getMyArtclePre,
    getArtcateById
}